{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "462bfcfb-cb9e-4762-b0fc-83f7c8e8553e",
   "metadata": {},
   "source": [
    "Feistel网络剔除了S必须可逆的要求"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "981bd59e-ee23-4d39-9be5-ea86c2a1e006",
   "metadata": {},
   "source": [
    "S盒-轮函数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d358d187-67c1-476b-98f3-c6ab5141bcf3",
   "metadata": {},
   "source": [
    "$$\n",
    "L_i:=R_{i-1} \\text { 和 } R_i:=L_{i-1} \\bigoplus f_i\\left(R_{i-1}\\right)\n",
    "$$"
   ]
  },
  {
   "attachments": {
    "c9e729a3-64b7-44cc-b787-49d70ae2ece7.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAAe0AAALPCAYAAABPOJhbAAAgAElEQVR4nO3da3ajOtcuUHjP7ldIywwtK9wyzo/6lJIJYMBcJJhzDI+9y3Fswu2xFpIou67rCgAgef87ewEAgHmENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgBkQmgDQCaENgCX93w+z16ETQht2EFZlqd9dtM0v5Yj/m/4efj/six/vS4833/f8Nr45+G5+H3in/c/L/6cod/vP+LP9fBY+6iq6uf/42MkO90FtW3b1XXd1XXdFUWx6SO85x7v7eHh4eFx7KOu67Mja5Gy67quuJCyPK+FA0CeconCS5XHBfZ91HX98t8jdF1X1HVddF338gjPheUJ/99/XX9545PE0Ptu+eh/XrwMHh53ewydN3LJj0u0tJumKdq2Ldq2fXk+bJjH43HGYkGSwsmprmvHBrcVrmvHAd62bfH19XXWIs1yidDuf0NyMoJx4Xi5wKEPH2uaZrQClqLsy+NDJQ2BDe/lUg4E/sk6tPvj7uLriQDwzuPxeGlpp/5lNuvQjq9hK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4IYkw3Us3YqiMbnwnbYW0FKWzftm2LP3/+bLx0w59XFPMrKuyv7DoXOAAgBzqiAUAmhDYAZEJoA0AmhDYAZEJoA0AmhDYAZEJoA0AmhDYAZEJoA0AmhDYAZEJoA0Am/j9VqNRxgu6QaAAAAABJRU5ErkJggg=="
    }
   },
   "cell_type": "markdown",
   "id": "c7a59182-cf6d-4d6e-8cc9-7ed95ebe5db1",
   "metadata": {},
   "source": [
    "![image.png](attachment:c9e729a3-64b7-44cc-b787-49d70ae2ece7.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a5b8ff4-bb96-482e-90a3-a00414907ae8",
   "metadata": {},
   "source": [
    "逆转 Feistel 网络。无论轮函数 $\\left\\{f_i\\right\\}$ 是如何定义的, Feistel 网络都是可逆的（从而不用考 虑变形函数 $\\left\\{\\widehat{f}_i\\right\\}$ 是什么)。为了证实这一点, 只需表明任何给定轮数的 Feistel 网络都是可逆 的。给定第 $i$ 轮的输出 $\\left(L_i, R_i\\right)$, 可以按照如下办法计算出 $\\left(L_{i-1}, R_{i-1}\\right)$ : 首先设 $R_{i-1}:=L_i$, 然后计算:\n",
    "$$\n",
    "L_{i-1}:=R_i \\oplus f_i\\left(R_{i-1}\\right)\n",
    "$$\n",
    "(如果知道了主密钥, 就可以从 $\\widehat{f}_i$ 推导出函数 $f_{i \\text { 。 }}$ ) 可以验证出结果是正确的, $\\left(L_{i-1}, R_{i-1}\\right)$ 正. 因此有:\n",
    "命题 5.2 令 $\\mathrm{F}$ 为由 Feistel 网络定义的加密函数。不考虑变形函数 $\\left\\{\\widehat{f}_i\\right\\}$ 和轮数, 对任意选 择的 $k, F_k$ 是一个置换。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "51e5f10c-761f-49f9-bede-bfba07b683b3",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "3a892eb8-2e50-4f99-9096-1602dead82b2",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "f4ce1a1e-12ab-4f80-afec-15d6d2cfc43d",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "ff71b59f-e950-4bc7-b447-573d6520ecab",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
